
//第一步：引入vue-router路由
import vueRouter from "vue-router"
// 引入components里面的相关组件
import HomeContainer from "./components/tapbar/HomeContainer.vue"
import MemberContainer from "./components/tapbar/MemberContainer.vue"
import ShopcarContainer from "./components/tapbar/ShopcarContainer.vue"
import SearchContainer from "./components/tapbar/SearchContainer.vue"
import NewsList from "./components/news/NewsList.vue"
import NewsInfo from "./components/news/NewsInfo.vue"
import PhotosList from "./components/photos/PhotosList.vue"
import PhotosInfo from "./components/photos/PhotosInfo.vue"
import GoodsList from "./components/goods/GoodsList.vue"
import GoodsInfo from "./components/goods/GoodsInfo.vue"
import GoodsDesc from "./components/goods/GoodsDesc.vue"
import GoodsComment from "./components/goods/GoodsComment.vue"

//第三步：创建router的路由实例
var router = new vueRouter({
    routes : [ //配置路由
        { path: "/",redirect:"/home"},
        { path: "/home" , component: HomeContainer },
        { path: "/member" , component: MemberContainer },
        { path: "/shopcar" , component: ShopcarContainer },
        { path: "/search" , component: SearchContainer },
        { path:"/home/newslist",component: NewsList },
        { path:"/home/newsinfo/:id",component: NewsInfo}, //指传递过来的是参数
        { path:"/home/photoslist",component: PhotosList},
        { path:"/home/photosinfo/:id",component: PhotosInfo },
        { path:"/home/goodslist",component: GoodsList },
        { path:"/home/goodsinfo/:id",component:GoodsInfo,name: 'goodsinfo' },
        { path:"/home/goodsdesc/:id",component:GoodsDesc,name: 'goodsdesc' },
        { path:"/home/goodscomment/:id",component:GoodsComment,name: 'goodscomment' }

    ],
    linkActiveClass:"mui-active" //配置路由每次路由切换成功进入激活状态
})

export default router